﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using ZhimeiSoft.Framework.Server.Connector.DAL.Interface;

namespace ZhimeiSoft.Framework.Server.Connector.Factory
{
    public class DalFactory
    {
        //private static readonly string path = ConfigurationManager.AppSettings["DalImpl"];
        private static readonly string path = "ZhimeiSoft.Framework.Server.Connector.DAL";

        public static IUserDal CreateUserDal()
        {
            string className = path + ".UserDal";
            return (IUserDal)Assembly.Load(path).CreateInstance(className);
        }

        public static ILoginDal CreateLoginDal()
        {
            string className = path + ".LoginDal";
            return (ILoginDal)Assembly.Load(path).CreateInstance(className);
        }
    }
}
